<%-- 
    Document   : mainReview
    Created on : Mar 30, 2012, 12:06:25 AM
    Author     : samph
--%>

<%@page import="MODEL.DAO.HibernateUtil"%>
<%@page import="MODEL.POJO.Testresults"%>
<%@page import="java.util.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<div id="content">
<div id="khung">
    <%
            int stt = 1;
            List<Testresults> dsTestresult =  (List<Testresults>)request.getAttribute("dsTestresult");
            String s =(String)request.getAttribute("insert").toString();
            String soluong =(String)request.getAttribute("soluong").toString();
           
         %>
    <div class="khungnho">
     <table  border="0"  width="100%" cellpadding="0" cellspacing="1">
            <tr bgcolor="#507DD2" style="color: #FFFFFF; font-size:14px; height:40px" align="center" >
                <th style="width: 50px"> Stt</th>
                <th > Họ Tên</th>
                <th> CMND </th>
                 <th > Mã Đề Thi </th>
                <th > Ngày Giờ Bắt Đầu   </th>
                <th >Ngày Giờ Kết Thúc </th>
                <th >Điểm</td>
            </tr>
                <%
                    int failed = 0;
                    for(int i = 0 ; i< dsTestresult.size(); i++)
                    {
                        Testresults ts = dsTestresult.get(i);
                        if(ts.getTestResultScore() < 5)
                            failed = failed + 1;
                 %>
                 <tr style="height: 30px">
                     <td> <%= stt++ %></td>
                     <td style="font-weight: bold"> <%= ts.getUsers().getUserFullname() %></td>
                     <td><%= ts.getUsers().getUserIdentityCard() %></td>
                     <td><a href="ResultController?action=viewdetails&examcode=<%= ts.getWarehouses().getWarehouseId() %>"><%= ts.getWarehouses().getWarehouseId() %></a></td>
                     <td> <%= ts.getTestResultDateTimeStarted() %>
                     <td> <%= ts.getTestResultDateTimeEnded()%></td>    
                     <td><%= ts.getTestResultScore() %> </td>
                      <%  HibernateUtil.getSessionFactory().close(); %>
                 </tr>
                  <% 
                    }
                %>
                    
            </table>
                
        </div>
                <div style="text-align: center;color: red;font-size: 15px;">Failed: <%= failed %> - Pass: <%= stt - failed - 1 %></div>
    </div>
</div>

 <div class="cleaner"></div>
